<div class="clientCompanies index">

  <section class="search">
    <h2><?php echo __('Listado de Empresas'); ?></h2>
    <?php echo $this->Form->input('Buscar:', array('class' => 'searchCompany', 'id' => 'searchCompany')) ?>
  </section>

  <div id="companies_list">
    <?php echo $this->element('clientCompanies/table'); ?>
  </div>

</div>
<div class="actions">
  <h3><?php echo __('Opciones'); ?></h3>
  <ul>
    <li><?php echo $this->Html->link(__('Crear Empresa'), array('action' => 'add')); ?></li>
    <li><?php echo $this->Html->link(__('Ver Ordenes de Ruta'), array('controller' => 'orders', 'action' => 'index')); ?></li>
    <li><?php echo $this->Html->link(__('Nueva Orden'), array('controller' => 'orders', 'action' => 'add')); ?> </li>
    <li><?php echo $this->Html->link(__('Listado Ordenes'), array('controller' => 'orders', 'action' => 'index')); ?> </li>
  </ul>
</div>

<script>
  $(document).ready(function(){
        
    //       Ajax Search keys press
    $('#searchCompany').keyup(function() {
      var name = $("#searchCompany").val();
      $("#companies_list").load('<? echo $this->Html->url('search') ?>',{name:name});
    });
        
  });
</script>